using System.Collections;
using System.Collections.Generic;

[System.Serializable]
public class UnitStatic : AbstractStatic {
	public float crawlVelMax = .5f;
	public float walkVelMax = 1;
	public float jogVelMax = 3;
	public float sprintVelMax = 5;
	
	public bool mobile = true; //Determines whether the unit can move or if it is stationary.
	public bool terrestrial = true; //Determines whether the unit can be on land.
	public bool marine = false; //Determines whether the unit can float over water.
	public bool aerial = false; //Determines whether the unit can fly through air.
	
	public float visibilityForwardOffset = 1; //The number of cells by which the sight circle is offset from the unit itself in the unit's forward direction. This value means that a unit does not necessarily see as far backward as it does forward.
	
	/*
	 * In a battle, the defending unit's defenseEffect is determined
	 * by the direction of the attack relative to the defending unit's position.
	 * In battle, the damage of an attack is subtracted from the defending
	 * unit's hp and calculated by the following:
	 * 
	 * defenseEffect = defenseEffects[direction]
	 * damage = attackEffect * distanceFromTarget / attackDamageRadius * (1 - defenseEffect) + 1
	 * 
	 * The distanceFromTarget in this case is the distance of a unit from the attack's target position.
	 * 
	 * Battle only occurs when a player logs in and orders a unit to fire
	 * on a position. Any unit(s) occupying that position then receive the full
	 * damage of the attack based on the value of the attacker's attackEffect.
	 * 
	 * Next, any units in range of the attacker, including the attacked
	 * unit if it has not been destroyed, with the same allegiance as the
	 * defender or from an ally of the defender counterattack the attacking
	 * unit. The damage incurred by the counterattack is calculated the same
	 * way normal attack damage is, but with the counterattackEffect in place of the
	 * attackEffect in the damage formula.
	 */
	public float attackSectorRadius = 0; //Maximum distance of an attackable target.
	public float attackSectorAngle = 0; //Angular breadth of the unit's attackable area.
	public float attackDamageRadius = 0; //Distance from an attacked target within which units will incur damage.
	public float attackEffect = 0; //An attack coefficient representing attack power.
	public string attackType = "";
	public float[] defenseEffects = new float[4]{0 , 0 , 0 , 0}; //A list of defense coefficients corresponding to each side of the unit. If a distant attack comes from an angle between two sides, their defense effects are interpolated.
	public float counterattackEffect = 0; //Replaces attackEffect when calculating counterattack damage after a unit is attacked within range.
	
	//TODO: Make units move with velocities proportionate to the mass they carry. If mass causes a unit to move more slowly, it should still expend the same movement cost.
	public int massMax = 0; //Total mass that can be carried by the unit.
	
	public Dictionary<Quantifiable,int> moveCost; //The costs of a movement per timestep.
	public Dictionary<Quantifiable,int> restCost; //The costs of rest per timestep.
	
	public UnitStatic ()
	{

	}
}
